const formatNumber = (number: number): string => {
  return number >= 10 ? `${number}` : `0${number}`;
};

const formatYYMMDDHHMM = (date: number): string => {
  if (!date) return '-';
  const curDate = new Date(date);
  return `${curDate.getFullYear()}-${formatNumber(curDate.getMonth() + 1)}-${formatNumber(
    curDate.getDate(),
  )} ${formatNumber(curDate.getHours())}:${formatNumber(curDate.getMinutes())}`;
};

export { formatYYMMDDHHMM };
